#include "qcolorpropertyeditor.h"

#include "qcoloreditordialog.h"

#include "../property/qabstractproperty.h"
#include "../objects/qabstracthost.h"

#include <QFontDialog>

QColorPropertyEditor::QColorPropertyEditor(QAbstractProperty *property,QWidget *parent):
    QButtonCommonEditor(property,parent)
{
}

void QColorPropertyEditor::btn_clicked()
{
    QColorEditorDialog dlg(m_property->get_value(),this);

    dlg.exec();

    if(dlg.get_ret()==1)
    {
        QVariant v=dlg.get_value();

        if(v!=m_property->get_value())
        {
            emit property_changed(v);
        }
    }
}

qRegisterPropertyEditor("Color",QColorPropertyEditor)
